rcar_gen3: drivers: qos: D3: Make DBSC settings local to dbsc_setting()
authorMarek Vasut <[email protected]>
Thu, 13 Jun 2019 22:51:47 +0000 (00:51 +0200)
committerMarek Vasut <[email protected]>
Mon, 17 Jun 2019 13:11:28 +0000 (15:11 +0200)
Move the DBSC write enabling and disabling to dbsc_setting() function,
to make it local, instead of having it all over the code.

Signed-off-by: Marek Vasut <[email protected]>
Change-Id: If8e5657c3230b5d82b551cb89b11c4d13a2d096b

drivers/staging/renesas/rcar/qos/D3/qos_init_d3.c

index 258abfc0e57886f74273a3cb14e963c160ee24a1..b58b7c4376aad04896b9e472a038fc70699e1e26 100644 (file)
@@ -20,6 +20,9 @@ static void dbsc_setting(void)
 {
        uint32_t md=0;
 
+       /* Register write enable */
+       io_write_32(DBSC_DBSYSCNT0, 0x00001234U);
+
        /* BUFCAM settings */
        io_write_32(DBSC_DBCAM0CNF1, 0x00043218);
        io_write_32(DBSC_DBCAM0CNF2, 0x000000F4);
@@ -65,12 +68,13 @@ static void dbsc_setting(void)
        io_write_32(DBSC_DBSCHQOS151, 0x00000030);
        io_write_32(DBSC_DBSCHQOS152, 0x00000020);
        io_write_32(DBSC_DBSCHQOS153, 0x00000010);
+
+       /* Register write protect */
+       io_write_32(DBSC_DBSYSCNT0, 0x00000000U);
 }
 
 void qos_init_d3(void)
 {
-       io_write_32(DBSC_DBSYSCNT0, 0x00001234);
-
        dbsc_setting();
 
        /* DRAM Split Address mapping */
@@ -159,5 +163,4 @@ void qos_init_d3(void)
        /* Resource Alloc start */
        io_write_32(QOSCTRL_RAEN,  0x00000001U);
 #endif /* !(RCAR_QOS_TYPE == RCAR_QOS_NONE) */
-       io_write_32(DBSC_DBSYSCNT0, 0x00000000);
 }